package com.weiqiao.mall.constant.e;

public enum AppUserTagEnum {

	ZERO("员工",0),
    ONE("客户",1),
    TWO("其他",2);

    private String name;// 状态名
    private int index;

    // 普通方法
    public static String getName(int index) {
        for (AppUserTagEnum s : AppUserTagEnum.values()) {
            if (s.getIndex() == index) {
                return s.name;
            }
        }
        return null;
    }

    public static int getIndex(String name) {
        for (AppUserTagEnum s : AppUserTagEnum.values()) {
            if (s.getName().equals(name)) {
                return s.index;
            }
        }
        return 0;
    }

    AppUserTagEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }


    public String getName() {
        return name;
    }
    public int getIndex() {
        return index;
    }
}
